<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateFeedbacksTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('feedbacks', function (Blueprint $table) {
			$table->bigIncrements('id')->unsigned(false);
			$table->bigInteger('member_id')->nullable();
			$table->foreign('member_id')->references('id')->on('members');
			$table->bigInteger('book_id')->nullable();
			$table->foreign('book_id')->references('id')->on('books');
			$table->bigInteger('section_id')->nullable();
			$table->foreign('section_id')->references('id')->on('sections');
			$table->text('content')->nullable();
			$table->string('status', 64)->default('pending');
			$table->nullableTimestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('feedbacks');
    }
}
